home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / postgres / postgre3.z / postgre3 / src / lib / H / utils / log.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-27  |  1.6 KB  |  61 lines

  1. /*
  2.  * log.h --
  3.  *    POSTGRES error logging definitions.
  4.  *
  5.  * Identification:
  6.  *    $Header: /private/postgres/src/lib/H/utils/RCS/log.h,v 1.11 1991/11/11 19:32:17 mer Exp $
  7.  */
  8.  
  9. #ifndef    LogIncluded    /* Include this file only once. */
  10. #define LogIncluded    1
  11.  
  12. #include "tmp/c.h"
  13.  
  14. #define NOTICE    0    /* random info - no special action */
  15. #define WARN    -1    /* Warning error - return to known state */
  16. #define FATAL    1    /* Fatal error - abort process */
  17. #define DEBUG    -2    /* debug message */
  18. #define NOIND    -3    /* debug message, don't indent as far */
  19.  
  20. #define PTIME    0x100    /* prepend time to message */
  21. #define POS    0x200    /* prepend source position to message */
  22. #define USER    0x400    /* send message to user */
  23. #define TERM    0x800    /* send message to terminal */
  24. #define DBLOG    0x1000    /* put message in per db log */
  25. #define SLOG    0x2000    /* put message in system log */
  26. #define ABORT    0x4000    /* abort process after logging */
  27.  
  28. #define ELOG_MAXLEN 4096
  29.  
  30. #define SYSLOG_FD    5    /* file descriptor for system log file */
  31. #define DBLOG_FD    6    /* file descriptor for dblog file */
  32.  
  33. extern int    Cline;
  34. extern char    *Cfile;
  35. extern int    ElogDebugIndentLevel;
  36.  
  37. #define TR(v, i, j)    (Cfile = __FILE__,Cline = __LINE__,v[i] & (1 << j))
  38. #define TRM(v, i)    (Cfile = __FILE__,Cline = __LINE__,v[i] != 0)
  39.  
  40. #define SETR(v, i, j)    v[i] |= (1 << j)
  41. #define SETRNG(v, s, e)    { int i = s; for (i = s; i <= e; i++) v[i] = -1; }
  42.  
  43. #define ALLOCV(i)    (long *)calloc(i, sizeof (long))
  44.  
  45. void
  46. EnableELog ARGS ((int enable));
  47.  
  48. /*
  49.  * elog --
  50.  *    Old error logging function.
  51.  */
  52. extern
  53. void
  54. elog ARGS(( int, ... ));
  55.  
  56. extern
  57. int
  58. dlog ARGS ((long lvl, char *mess));
  59.  
  60. #endif    /* !defined(LogIncluded) */
  61.